package com.pvo.vo;

import org.apache.commons.lang.StringUtils;

public class FieldVO {
	
	/** 是否是主键 */
	private boolean primaryKey;

	/** 字段类型类名 */
	private String type;

	/** 字段名称 */
	private String fieldName;
	
	private String comment;
	
	private boolean timestamp;
	
	private ColumnVO columnVO;
	
	
	public String getShortTypeName() {
		if (type == null || type.trim().length() <= 0) {
			return null;
		}
		return type.substring(type.lastIndexOf(".")+1);
		
	}
	
	public String getCaptialFieldName() {
		if (fieldName == null || fieldName.trim().length() <= 0) {
			return null;
		}
		return StringUtils.capitalize(fieldName);
		
	}
	

	public boolean isPrimaryKey() {
		return primaryKey;
	}

	public void setPrimaryKey(boolean primaryKey) {
		this.primaryKey = primaryKey;
	}



	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getFieldName() {
		return fieldName;
	}

	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public ColumnVO getColumnVO() {
		return columnVO;
	}

	public void setColumnVO(ColumnVO columnVO) {
		this.columnVO = columnVO;
	}



	public boolean isTimestamp() {
		return timestamp;
	}

	public void setTimestamp(boolean timestamp) {
		this.timestamp = timestamp;
	}



	

}
